<html>
<head><meta charset="utf-8"><title>Prelude Changes Lint · edition 2021 · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/index.html">edition 2021</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html">Prelude Changes Lint</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="240278703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240278703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240278703">(May 26 2021 at 04:31)</a>:</h4>
<p>Ok so I've started <a href="https://github.com/rust-lang/rust/pull/85707">an initial implementation</a> of the prelude migration lint. However one issue I ran into from the suggested implementation strategy. While <code>FnCtxt::lookup_method</code> works great for dot-call syntax, it doesn't seem like it works for associated functions, but I'm having a bit of trouble finding a suitable equivalent. <span class="user-mention" data-user-id="116009">@nikomatsakis</span> whenever you have a moment, I'd appreciate a bit of guidance on where a good place to put this might be</p>



<a name="240282773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240282773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240282773">(May 26 2021 at 06:06)</a>:</h4>
<p>So to my understanding, doing a similar implementation in rustc_typeck would be complicated because looking for <code>MyType::try_from(x)</code> would require looking for a call of the structure <code>$path ( $( $expr ),*  )</code>, but since <code>$path</code> will get resolved/type checked at a separate point from the actual call it won't have access to the span of the call itself (which is needed for emitting a <code>MachineApplicable</code> lint)... but since $path is actually also an expression this further complicates it... and something like this:</p>
<div class="codehilite"><pre><span></span><code>let my_try_from = MyTryFrom::try_from;
let x = my_try_from(3);
</code></pre></div>
<p>would then break ...wait is the call itself even needed for the lint in this case? I think I have been barking up the wrong tree and I could just be emitting a lint on the path for the associated-function case <span aria-label="face palm" class="emoji emoji-1f926" role="img" title="face palm">:face_palm:</span></p>
<p>Just need to find where the paths for trait-associated functions get resolved now</p>



<a name="240368592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240368592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dirkjan Ochtman <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240368592">(May 26 2021 at 18:25)</a>:</h4>
<p>I'd think we don't need to do anything with associated function calls?</p>



<a name="240368616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240368616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dirkjan Ochtman <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240368616">(May 26 2021 at 18:25)</a>:</h4>
<p>Since they already reference a specific trait by nature of being associated, right?</p>



<a name="240370283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240370283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240370283">(May 26 2021 at 18:36)</a>:</h4>
<p>Well, if it's called as <code>u64::try_from(...)</code> I think it can still be a problem.</p>



<a name="240372619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240372619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dirkjan Ochtman <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240372619">(May 26 2021 at 18:53)</a>:</h4>
<p>Oh, true</p>



<a name="240380839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240380839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240380839">(May 26 2021 at 19:49)</a>:</h4>
<p>Yeah my initial impression was also thinking dot-call was the only issue, or at least the main one, but it turns out it's more so the opposite. Both <code>TryFrom</code> and <code>FromIterator</code> only have breaking changes  from associated function calls, while <code>TryInto</code> actually has breaking changes for both dot-call and associated functions, so arguably dot-call is actually the special case :P</p>



<a name="240394982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240394982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Daniel Henry-Mantilla <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240394982">(May 26 2021 at 21:35)</a>:</h4>
<p>Maybe it's <code>.resolve_ufcs(…)</code></p>



<a name="240409403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240409403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240409403">(May 27 2021 at 00:56)</a>:</h4>
<p>Ah that'd make sense, I always forget those are sometimes called "universal function calls" so I didn't recognize the acronym. Thanks!</p>



<a name="240409901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240409901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240409901">(May 27 2021 at 01:05)</a>:</h4>
<p>yep that was it :)</p>



<a name="240421670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240421670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240421670">(May 27 2021 at 05:18)</a>:</h4>
<p>Outside of any issues arising during review, the lint itself should be done <a href="https://github.com/rust-lang/rust/pull/85707">https://github.com/rust-lang/rust/pull/85707</a></p>



<a name="240472175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240472175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240472175">(May 27 2021 at 14:04)</a>:</h4>
<p>Nice work, <span class="user-mention" data-user-id="322737">@jam1garner</span></p>



<a name="240485445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240485445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240485445">(May 27 2021 at 15:28)</a>:</h4>
<p><span class="user-mention" data-user-id="322737">@jam1garner</span> let me know if i can help with investigating those issues i mentioned, or making minimal test cases for them.</p>



<a name="240485493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240485493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240485493">(May 27 2021 at 15:28)</a>:</h4>
<p>(and thanks for making this lint!)</p>



<a name="240497171"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240497171" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240497171">(May 27 2021 at 16:46)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> you meanted <code>raw_addr!</code> in your review in relation to <code>autoref_or_ptr_adjustment</code>, but the docs describe the pointer adjustment as "Receiver has type <code>*mut T</code>, convert to <code>*const T</code>", so maybe I'm missing something, but how would <code>raw_addr!</code> play into that?</p>



<a name="240498469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240498469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240498469">(May 27 2021 at 16:56)</a>:</h4>
<p>(correct me if I'm wrong but I don't think <code>AutoRefOrPtrAdjustment::ToConstPtr</code> actually needs to be handled, given arguments are a coercion site)</p>



<a name="240531573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240531573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240531573">(May 27 2021 at 21:05)</a>:</h4>
<p>One problem I'm having--which maybe one of you could shed some light on how to approach it--is that within a given scope I want get a reference-able path for a <code>DefId</code>. I currently use <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html#method.def_path_str">TyCtxt::def_path_str</a> but this causes some issues <a href="https://github.com/rust-lang/rust/pull/85707#issuecomment-849885664">I explain in this comment</a>. Preferably there'd be an API on, say, a FnCtxt which allows to get what the path to the <code>DefId</code> would be within the function's scope, but as far as I can tell nothing like that exists.</p>



<a name="240531926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240531926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240531926">(May 27 2021 at 21:07)</a>:</h4>
<p>Although I could very well be looking at this from the wrong angle and there's a different way to approach this--I can't say this feels like a problem that hasn't come up before</p>



<a name="240605346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240605346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240605346">(May 28 2021 at 13:42)</a>:</h4>
<p><span class="user-mention silent" data-user-id="322737">jam1garner</span> <a href="#narrow/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint/near/240497171">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> you meanted <code>raw_addr!</code> in your review in relation to <code>autoref_or_ptr_adjustment</code>, but the docs describe the pointer adjustment as "Receiver has type <code>*mut T</code>, convert to <code>*const T</code>", so maybe I'm missing something, but how would <code>raw_addr!</code> play into that?</p>
</blockquote>
<p>you're probably right that no action is needed there because it would get coerced anyway; if we wanted to be explicit, though, the way to convert a <code>*mut T</code> to a <code>*const T</code> manually would be either via an <code>as</code> or <code>str::ptr::addr_of!(*x)</code></p>



<a name="240605384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240605384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240605384">(May 28 2021 at 13:42)</a>:</h4>
<p><span class="user-mention silent" data-user-id="322737">jam1garner</span> <a href="#narrow/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint/near/240531573">said</a>:</p>
<blockquote>
<p>One problem I'm having--which maybe one of you could shed some light on how to approach it--is that within a given scope I want get a reference-able path for a <code>DefId</code>. I currently use <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html#method.def_path_str">TyCtxt::def_path_str</a> but this causes some issues <a href="https://github.com/rust-lang/rust/pull/85707#issuecomment-849885664">I explain in this comment</a>. Preferably there'd be an API on, say, a FnCtxt which allows to get what the path to the <code>DefId</code> would be within the function's scope, but as far as I can tell nothing like that exists.</p>
</blockquote>
<p>yeah, I'm not totally sure the best approach there, it does feel like something that has probably come up before</p>



<a name="240605407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240605407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240605407">(May 28 2021 at 13:42)</a>:</h4>
<p>there seem to be two cases:</p>



<a name="240605419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240605419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240605419">(May 28 2021 at 13:43)</a>:</h4>
<ul>
<li>things that are scoped within a function</li>
</ul>



<a name="240605435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240605435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240605435">(May 28 2021 at 13:43)</a>:</h4>
<ul>
<li>things that can be named via some crate-relative path</li>
</ul>



<a name="240605482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240605482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240605482">(May 28 2021 at 13:43)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint/near/240605419">said</a>:</p>
<blockquote>
<ul>
<li>things that are scoped within a function</li>
</ul>
</blockquote>
<p>in this case I imagine you have to just use the name of the trait with no qualification</p>



<a name="240605587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240605587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240605587">(May 28 2021 at 13:44)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint/near/240605435">said</a>:</p>
<blockquote>
<ul>
<li>things that can be named via some crate-relative path</li>
</ul>
</blockquote>
<p>this case you can use an absolute path, probably the same path <code>def_path_str</code> gives you; it's not ideal because it'd be nice to consider the use statements in scope, but that's harder. Maybe there's a simple way to capture the case where the trait is directly imported.</p>



<a name="240606275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240606275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240606275">(May 28 2021 at 13:49)</a>:</h4>
<p>I'm reading how <code>def_path_str</code> works now</p>



<a name="240627354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240627354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240627354">(May 28 2021 at 16:19)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint/near/240605346">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="322737">jam1garner</span> <a href="#narrow/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint/near/240497171">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> you meanted <code>raw_addr!</code> in your review in relation to <code>autoref_or_ptr_adjustment</code>, but the docs describe the pointer adjustment as "Receiver has type <code>*mut T</code>, convert to <code>*const T</code>", so maybe I'm missing something, but how would <code>raw_addr!</code> play into that?</p>
</blockquote>
<p>you're probably right that no action is needed there because it would get coerced anyway; if we wanted to be explicit, though, the way to convert a <code>*mut T</code> to a <code>*const T</code> manually would be either via an <code>as</code> or <code>str::ptr::addr_of!(*x)</code></p>
</blockquote>
<p>I was actually wrong because since the form to expand to for methods is <code>Trait::method(&lt;self&gt;, args...)</code>, self's type needs to be correct, otherwise it won't be able to infer what T is for the desugaring of <code>&lt;T as Trait&gt;::method</code>. ptr::addr_of, however, doesn't work as <code>ptr::addr_of!(*ptr)</code> is actually unsafe (as currently addr_of presents the same safety requirements as its inner expression, according to the docs)</p>



<a name="240627765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/240627765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#240627765">(May 28 2021 at 16:23)</a>:</h4>
<p>Also as for <code>def_path_str</code> for absolute paths: that doesn't actually work, <code>def_path_str</code> returns user-disambiguated paths. That is to say, the minimum path that makes it clear to a human which type you're talking about. i.e. if you define a type within a function that has the same name as some type somewhere else, it will use <code>my_function::MyType</code>, which is not a valid path. (This isn't a hypothetical, this actually happens on one of the crates that Mara pointed out from the crater run)</p>



<a name="241152485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/241152485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#241152485">(Jun 02 2021 at 13:58)</a>:</h4>
<p><span class="user-mention" data-user-id="322737">@jam1garner</span> I'm looking at your PR now</p>



<a name="241152505"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/241152505" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#241152505">(Jun 02 2021 at 13:58)</a>:</h4>
<p>I'm going to create a hackmd to help track the current status, as I'm feeling a bit lost</p>



<a name="241152539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/241152539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#241152539">(Jun 02 2021 at 13:59)</a>:</h4>
<p>I guess I can't, beacuse of server maintenance</p>



<a name="241153506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/241153506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#241153506">(Jun 02 2021 at 14:05)</a>:</h4>
<p><a href="https://gist.github.com/nikomatsakis/025b6ca6a3b9df75a11ce4ae6c8a663e">https://gist.github.com/nikomatsakis/025b6ca6a3b9df75a11ce4ae6c8a663e</a></p>



<a name="241571438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/241571438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#241571438">(Jun 04 2021 at 17:53)</a>:</h4>
<p>let me circle back to this</p>



<a name="242628201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242628201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242628201">(Jun 14 2021 at 16:58)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="310399">@Mara</span> -- I have a question --</p>



<a name="242628212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242628212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242628212">(Jun 14 2021 at 16:58)</a>:</h4>
<p>you were running tests with the new prelude, how did you do that?</p>



<a name="242628219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242628219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242628219">(Jun 14 2021 at 16:58)</a>:</h4>
<p>just with <code>--edition 2021</code>?</p>



<a name="242628265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242628265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242628265">(Jun 14 2021 at 16:59)</a>:</h4>
<p>mabe this PR needs to be rebased?</p>



<a name="242628303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242628303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242628303">(Jun 14 2021 at 16:59)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> yeah that works. but i just changed the contents of the <code>std::prelude::rust_2018</code> module :)</p>



<a name="242628331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242628331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242628331">(Jun 14 2021 at 16:59)</a>:</h4>
<p>I can't get this to compile</p>



<a name="242628338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242628338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242628338">(Jun 14 2021 at 16:59)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="o">&lt;</span><span class="nb">Vec</span><span class="o">&lt;</span><span class="kt">i32</span><span class="o">&gt;&gt;</span>::<span class="n">from_iter</span><span class="p">(</span><span class="nb">None</span><span class="p">);</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="242628345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242628345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242628345">(Jun 14 2021 at 16:59)</a>:</h4>
<p>(with edition 2021)</p>



<a name="242628348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242628348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242628348">(Jun 14 2021 at 16:59)</a>:</h4>
<p>i think i even posted that diff somewhere on the pr</p>



<a name="242628358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242628358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242628358">(Jun 14 2021 at 16:59)</a>:</h4>
<p>but shouldn't it?</p>



<a name="242628415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242628415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242628415">(Jun 14 2021 at 17:00)</a>:</h4>
<p>it does no nightly</p>



<a name="242628424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242628424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242628424">(Jun 14 2021 at 17:00)</a>:</h4>
<p>so I guess the PR just needs to be rebased</p>



<a name="242628500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242628500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242628500">(Jun 14 2021 at 17:00)</a>:</h4>
<p>oh yeah, that PR doesn't include the new prelude changes yet. its 2021 prelude is identical to 2018</p>



<a name="242628546"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242628546" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242628546">(Jun 14 2021 at 17:01)</a>:</h4>
<p>i just added the imports to <code>rust_2018</code> directly to test it</p>



<a name="242628617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242628617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242628617">(Jun 14 2021 at 17:01)</a>:</h4>
<p>here: <a href="https://github.com/rust-lang/rust/pull/85707#issuecomment-850369498">https://github.com/rust-lang/rust/pull/85707#issuecomment-850369498</a></p>



<a name="242628774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242628774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242628774">(Jun 14 2021 at 17:02)</a>:</h4>
<p>ok</p>



<a name="242633531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242633531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242633531">(Jun 14 2021 at 17:36)</a>:</h4>
<p>rebased (heads up, <span class="user-mention" data-user-id="322737">@jam1garner</span>)</p>



<a name="242692363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242692363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242692363">(Jun 15 2021 at 06:25)</a>:</h4>
<p>Ok I think we're getting pretty close! I pushed another two commits, which I talk a bit about here <a href="https://github.com/rust-lang/rust/pull/85707#issuecomment-861206263">https://github.com/rust-lang/rust/pull/85707#issuecomment-861206263</a> (added to 2021 compatibility lint group, changed from warn to allow, fixed additional arguments not being passed in fix suggestion)</p>
<p>all that should be left is fixing the trait-path issue, either by absolute paths as Mara said, or by some other means. It is a bit past 2 am for me, so it will likely have to wait until sometime after I'm off work tomorrow</p>



<a name="242743300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242743300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242743300">(Jun 15 2021 at 14:44)</a>:</h4>
<p><span class="user-mention" data-user-id="322737">@jam1garner</span> great!</p>



<a name="242743318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242743318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242743318">(Jun 15 2021 at 14:44)</a>:</h4>
<p>I was debating about the trait path question</p>



<a name="242743354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242743354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242743354">(Jun 15 2021 at 14:44)</a>:</h4>
<p>One weird quirk of Rust is that "absolute paths" aren't <em>entirely</em> a thing</p>



<a name="242743378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242743378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242743378">(Jun 15 2021 at 14:45)</a>:</h4>
<p>that is, the correct path to use to name something might not be absolute</p>



<a name="242743415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242743415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242743415">(Jun 15 2021 at 14:45)</a>:</h4>
<p>I am wondering if there is a helper function for finding "all viable paths"</p>



<a name="242743467"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242743467" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242743467">(Jun 15 2021 at 14:45)</a>:</h4>
<p><span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span>, do you remember if there is a convenient function for finding "all relevant paths to an item from within the crate"? I feel like you might know if anyone does.</p>



<a name="242744529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242744529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242744529">(Jun 15 2021 at 14:52)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint/near/242743354">said</a>:</p>
<blockquote>
<p>One weird quirk of Rust is that "absolute paths" aren't <em>entirely</em> a thing</p>
</blockquote>
<p>that's true. I suppose between re-exports, function-scoped traits, etc. that doesn't really make sense. I guess the only real solution is getting the accessible paths for it within the given scope (as I'm not sure within the current crate is quite enough)</p>



<a name="242744889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242744889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242744889">(Jun 15 2021 at 14:54)</a>:</h4>
<p>My best guess would be looking at the suggested imports fix suggestions, but that'd likely point as to how to implement it and not as to whether there's already a means of doing that (as imports have a slightly different goal as to what they're searching for)</p>



<a name="242749545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242749545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242749545">(Jun 15 2021 at 15:18)</a>:</h4>
<p>in all cases where this lint is relevant, the trait must've been imported explicitly by a <code>use $path;</code> or <code>use $path as $name;</code> or <code>use $path as _;</code>, right? in the first case, the trait name can be used directly. in the second, $name can be used directly, and in the third, $path should work. right? can we somehow get the <code>use</code> statement that imported a trait?</p>



<a name="242749761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242749761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242749761">(Jun 15 2021 at 15:19)</a>:</h4>
<p>I was wondering about that</p>



<a name="242749775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242749775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242749775">(Jun 15 2021 at 15:19)</a>:</h4>
<p>That's a good idea, <span class="user-mention" data-user-id="310399">@Mara</span></p>



<a name="242749851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242749851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242749851">(Jun 15 2021 at 15:20)</a>:</h4>
<p>Name resolution currently prepares the list of "in-scope traits"</p>



<a name="242749856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242749856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242749856">(Jun 15 2021 at 15:20)</a>:</h4>
<p>Let me see what shape that takes</p>



<a name="242749873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242749873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242749873">(Jun 15 2021 at 15:20)</a>:</h4>
<p>It may have a link to a use, or maybe it could be made to do so</p>



<a name="242749907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242749907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242749907">(Jun 15 2021 at 15:20)</a>:</h4>
<p>(oh there's also the case where the trait was defined in the same module. so then there's no <code>use</code>)</p>



<a name="242749922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242749922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242749922">(Jun 15 2021 at 15:20)</a>:</h4>
<p>Yes, that's an easy one</p>



<a name="242749932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242749932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242749932">(Jun 15 2021 at 15:20)</a>:</h4>
<p>yeah ^^</p>



<a name="242749948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242749948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242749948">(Jun 15 2021 at 15:20)</a>:</h4>
<p>the tl;dr is maybe we can have name resolution tell us this info</p>



<a name="242749980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242749980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242749980">(Jun 15 2021 at 15:21)</a>:</h4>
<p>which seems like a good idea</p>



<a name="242776276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242776276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242776276">(Jun 15 2021 at 18:18)</a>:</h4>
<blockquote>
<p>convenient function for finding "all relevant paths to an item from within the crate"</p>
</blockquote>
<p>Sounds similar to the stuff from <a href="https://github.com/rust-lang/rust/pull/73996">https://github.com/rust-lang/rust/pull/73996</a>.<br>
It's expensive to calculate though, so it's only done when there are errors.</p>



<a name="242928577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242928577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242928577">(Jun 16 2021 at 19:14)</a>:</h4>
<p><span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span> well that aplies in this case</p>



<a name="242928727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242928727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242928727">(Jun 16 2021 at 19:15)</a>:</h4>
<p>I liked <span class="user-mention" data-user-id="310399">@Mara</span>'s idea though</p>



<a name="242996743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242996743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242996743">(Jun 17 2021 at 10:11)</a>:</h4>
<p>OK, I poked at this a bit. I pushed a WIP commit that <em>does</em> identify the import id, but doesn't do anything useful with it yet. It also includes two test files that show all the various edge cases  we need to consider, I believe.</p>



<a name="242996776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242996776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242996776">(Jun 17 2021 at 10:11)</a>:</h4>
<p>There is a <code>debug!</code> at the point where we identify the import, I think the next step is to run with <code>RUSTC_LOG</code> and figure out what we need to do to determine the path and if this is a <code>_</code> import</p>



<a name="242996839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242996839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242996839">(Jun 17 2021 at 10:12)</a>:</h4>
<p><code>RUSTC_LOG=rustc_typeck::check::method::prelude2021</code> that is</p>



<a name="242996860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/242996860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#242996860">(Jun 17 2021 at 10:12)</a>:</h4>
<p><span class="user-mention" data-user-id="322737">@jam1garner</span> <span aria-label="point up" class="emoji emoji-1f446" role="img" title="point up">:point_up:</span></p>



<a name="243004753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243004753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243004753">(Jun 17 2021 at 11:38)</a>:</h4>
<p>nice!</p>



<a name="243030997"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243030997" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243030997">(Jun 17 2021 at 15:00)</a>:</h4>
<p>one case I didn't add tests for: the same trait may be imported from multiple places (some named, some not), I believe</p>



<a name="243031101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243031101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243031101">(Jun 17 2021 at 15:01)</a>:</h4>
<p>partly I didn't add a test because it didn't seem to matter which one we choose; we could look for a "best" though</p>



<a name="243031261"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243031261" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243031261">(Jun 17 2021 at 15:02)</a>:</h4>
<p>fun:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">use</span><span class="w"> </span><span class="n">std</span>::<span class="n">io</span>::<span class="n">Read</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="n">_</span><span class="p">;</span><span class="w"></span>
<span class="k">use</span><span class="w"> </span><span class="n">std</span>::<span class="n">io</span>::<span class="n">Read</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="n">A</span><span class="p">;</span><span class="w"></span>
<span class="k">use</span><span class="w"> </span><span class="n">std</span>::<span class="n">io</span>::<span class="n">Read</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="n">B</span><span class="p">;</span><span class="w"></span>

<span class="k">pub</span><span class="w"> </span><span class="k">trait</span><span class="w"> </span><span class="n">X</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">use</span><span class="w"> </span><span class="bp">self</span>::<span class="n">X</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="n">_</span><span class="p">;</span><span class="w"></span>
<span class="k">use</span><span class="w"> </span><span class="bp">self</span>::<span class="n">X</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="n">C</span><span class="p">;</span><span class="w"></span>
<span class="k">use</span><span class="w"> </span><span class="bp">self</span>::<span class="n">X</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="n">D</span><span class="p">;</span><span class="w"></span>
</code></pre></div>



<a name="243179676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243179676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243179676">(Jun 18 2021 at 15:58)</a>:</h4>
<p><span class="user-mention" data-user-id="322737">@jam1garner</span> have you had any time to poke on this? (I <em>might</em> put in a bit of time over the next hour, will let you know if anything gets done)</p>



<a name="243182209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243182209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243182209">(Jun 18 2021 at 16:21)</a>:</h4>
<p><span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span> it seems to me that the <a href="https://github.com/jam1garner/rust/blob/dbc9da7962b7282c5752a7bc2c9907694b7c158c/compiler/rustc_hir/src/hir.rs#L2750-L2755"><code>HirKind::Use</code></a> simply doesn't store the "as X" part of the name -- am I missing something?</p>



<a name="243182337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243182337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243182337">(Jun 18 2021 at 16:22)</a>:</h4>
<p><em>oh</em></p>



<a name="243182341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243182341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243182341">(Jun 18 2021 at 16:22)</a>:</h4>
<p>it's the <code>ident</code> of the Item</p>



<a name="243182344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243182344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243182344">(Jun 18 2021 at 16:22)</a>:</h4>
<p>got it</p>



<a name="243184491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243184491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243184491">(Jun 18 2021 at 16:44)</a>:</h4>
<p>I have today off, so I was planning on sinking some work into it mid-afternoon. So I can probably just follow up where you leave off!</p>



<a name="243185576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243185576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243185576">(Jun 18 2021 at 16:55)</a>:</h4>
<p>ok, I made some progress</p>



<a name="243185579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243185579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243185579">(Jun 18 2021 at 16:55)</a>:</h4>
<p>I'll push a commit</p>



<a name="243187913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243187913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243187913">(Jun 18 2021 at 17:19)</a>:</h4>
<p><span class="user-mention" data-user-id="322737">@jam1garner</span> done</p>



<a name="243187921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243187921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243187921">(Jun 18 2021 at 17:19)</a>:</h4>
<p>there is a FIXME for what I believe to be the final step</p>



<a name="243190799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243190799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243190799">(Jun 18 2021 at 17:46)</a>:</h4>
<p>Sweet! I’ll take care of that. Thanks for all the help :)</p>



<a name="243201387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243201387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243201387">(Jun 18 2021 at 19:47)</a>:</h4>
<p>well. it's 'fortunate' for us that it seems like ffishim's organization makes for quite the edge case as far as covering issues. I made a minimal example: <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=3465791fd3f15823212fa413e522ec1c">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=3465791fd3f15823212fa413e522ec1c</a></p>



<a name="243201494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243201494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243201494">(Jun 18 2021 at 19:48)</a>:</h4>
<p>one thing I realized from this: I think in certain cases it's actually impossible to automatically migrate?</p>



<a name="243202077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243202077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243202077">(Jun 18 2021 at 19:55)</a>:</h4>
<blockquote>
<p>I think in certain cases it's actually impossible to automatically migrate?</p>
</blockquote>
<p>that is incorrect, I'm finding, as the trait being private to you means you can't call the method on <code>dyn Trait</code> (playground link: <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=f7be46b23cd970a78a18e48d35b3ef7b">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=f7be46b23cd970a78a18e48d35b3ef7b</a> )</p>



<a name="243202184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243202184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243202184">(Jun 18 2021 at 19:56)</a>:</h4>
<p>this whole migration could've been a lot easier if we had an unimport statement</p>



<a name="243202201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243202201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243202201">(Jun 18 2021 at 19:57)</a>:</h4>
<p><code>use !std::convert::TryInto;</code></p>



<a name="243202203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243202203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243202203">(Jun 18 2021 at 19:57)</a>:</h4>
<p>however the primary issue still stands: if the method is called on <code>dyn Trait</code>, the trait itself doesn't need to be in scope, meaning our assumption of "there must be an import" is incorrect</p>



<a name="243202260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243202260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243202260">(Jun 18 2021 at 19:57)</a>:</h4>
<p>but is that a case that would actually break with the new prelude?</p>



<a name="243202339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243202339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243202339">(Jun 18 2021 at 19:58)</a>:</h4>
<p>from what I can tell without double checking, yes? that seems to be happening in ffishim</p>



<a name="243202341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243202341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243202341">(Jun 18 2021 at 19:58)</a>:</h4>
<p>ah, yeah if you put the <code>use</code> inside the module in your example, it breaks :(</p>



<a name="243202413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243202413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243202413">(Jun 18 2021 at 19:59)</a>:</h4>
<p>the fun part about this one was, since ffishim has a struct of the same name which implements the trait, I believe the current code gives a semi-working correction that only fails due to type incompatibility</p>



<a name="243202442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243202442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243202442">(Jun 18 2021 at 19:59)</a>:</h4>
<p>in a more convoluted example I'm fairly certain you could abuse associated types in order to make an example of this that actually compiles on our current code but has different behavior</p>



<a name="243202607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243202607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243202607">(Jun 18 2021 at 20:01)</a>:</h4>
<p>I'm guessing the fix for this is just to detect the case of <code>self</code> being <code>dyn Trait</code>/something that derefs to <code>dyn Trait</code>?</p>



<a name="243202748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243202748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243202748">(Jun 18 2021 at 20:02)</a>:</h4>
<p><span class="user-mention" data-user-id="322737">@jam1garner</span> is't the fix here to keep the method syntax, put apply the autoderef expicitly?</p>



<a name="243202751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243202751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243202751">(Jun 18 2021 at 20:02)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="p">(</span><span class="o">*</span><span class="n">get_dyn_trait</span><span class="p">()).</span><span class="n">try_into</span><span class="p">().</span><span class="n">unwrap</span><span class="p">()</span><span class="w"></span>
</code></pre></div>



<a name="243202774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243202774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243202774">(Jun 18 2021 at 20:02)</a>:</h4>
<p>that compiles</p>



<a name="243202789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243202789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243202789">(Jun 18 2021 at 20:02)</a>:</h4>
<p>with the new prelude import inside the module</p>



<a name="243202971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243202971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243202971">(Jun 18 2021 at 20:04)</a>:</h4>
<p>huh. could impl dyn Trait or something similar break that? (even if it could, that's bordering on "must be intentionally trying to break this lint" territory)</p>



<a name="243203008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243203008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243203008">(Jun 18 2021 at 20:05)</a>:</h4>
<p>the problem doesn't seem to be that the <code>.try_into()</code> becomes ambiguous. the problem here was that the autoderef no longer happens, because the TryInto trait  now matches without deref.</p>



<a name="243203097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243203097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243203097">(Jun 18 2021 at 20:06)</a>:</h4>
<p>the error was</p>
<div class="codehilite"><pre><span></span><code>the trait bound `u32: From&lt;Box&lt;dyn TryIntoU32&gt;&gt;` is not satisfied
</code></pre></div>
<p>and not something about ambiguity</p>



<a name="243203260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243203260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243203260">(Jun 18 2021 at 20:08)</a>:</h4>
<p>yes, although my question is: could the new deref + import cause ambiguity that wasn't possible before? (most of what I've tried indicates no)</p>



<a name="243203429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243203429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243203429">(Jun 18 2021 at 20:10)</a>:</h4>
<p>I think the answer <em>would</em> be yes, if <code>try_into</code> wasn't consuming (i.e. used <code>&amp;self</code>) as that means it must be <code>Sized</code>, which means you can't implement <code>TryInto&lt;u32&gt; for dyn TryIntoU32</code></p>



<a name="243203468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243203468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243203468">(Jun 18 2021 at 20:10)</a>:</h4>
<p>but due to that implicit Sized bounds, it coincidentally isn't possible to make it amibiguous</p>



<a name="243203483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243203483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243203483">(Jun 18 2021 at 20:10)</a>:</h4>
<p>nice</p>



<a name="243203519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243203519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243203519">(Jun 18 2021 at 20:11)</a>:</h4>
<p>also, the migration doesn't have to be absolutely perfect.</p>



<a name="243203531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243203531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243203531">(Jun 18 2021 at 20:11)</a>:</h4>
<p>I think I'll leave a comment as warning, just in case this code gets reused in the future</p>



<a name="243203613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243203613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243203613">(Jun 18 2021 at 20:12)</a>:</h4>
<p>it doesn't matter for us now, but I'd hate to be the person to have to come up with this edge case in the future if it ever <em>does</em> matter</p>



<a name="243203623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243203623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243203623">(Jun 18 2021 at 20:12)</a>:</h4>
<p>in all likelihood I don't think it'll ever matter, but eh why not</p>



<a name="243203634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243203634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243203634">(Jun 18 2021 at 20:12)</a>:</h4>
<p>sounds good  ^^</p>



<a name="243203762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243203762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243203762">(Jun 18 2021 at 20:14)</a>:</h4>
<p>and just to make sure we're on the same page before I implement, the idea is to</p>
<p>(a) check if self is <code>dyn Trait</code><br>
(b) if so, instead of switching to fully qualified syntax, just add the derefs to self</p>



<a name="243203925"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243203925" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243203925">(Jun 18 2021 at 20:16)</a>:</h4>
<p>yeah that sounds right! but i don't have as much context about the problem as you do, so i can't tell you if that solves all the weird cases you saw ^^'</p>



<a name="243203958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243203958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243203958">(Jun 18 2021 at 20:17)</a>:</h4>
<p>i can imagine it gets a bit annoying for <code>dyn Trait + Thing + ..</code> and things like that.</p>



<a name="243204001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243204001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243204001">(Jun 18 2021 at 20:17)</a>:</h4>
<p>(quite possibly it's not worth it to handle those)</p>



<a name="243204048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243204048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243204048">(Jun 18 2021 at 20:18)</a>:</h4>
<p>yeahhhhh I was thinking the same thing</p>



<a name="243204093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243204093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243204093">(Jun 18 2021 at 20:18)</a>:</h4>
<p>I'm frankly surprised the crater run hit such an impressive edge case. I would be surprised if there is any real-world example of a more difficult to handle variant of this</p>



<a name="243204110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243204110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243204110">(Jun 18 2021 at 20:19)</a>:</h4>
<p>just fork() the compiler to try out a few different solutions until one compiles <span aria-label="grimacing" class="emoji emoji-1f62c" role="img" title="grimacing">:grimacing:</span></p>



<a name="243204121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243204121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243204121">(Jun 18 2021 at 20:19)</a>:</h4>
<p>exactly, ezpz</p>



<a name="243204146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243204146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243204146">(Jun 18 2021 at 20:19)</a>:</h4>
<p>alternative solution: it'd be easier for me to just manually migrate those people's code for them than to go further down this edge case rabbit hole :)</p>



<a name="243204244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243204244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243204244">(Jun 18 2021 at 20:20)</a>:</h4>
<p>i'd be super happy with this migration even if it doesn't handle that case at all</p>



<a name="243251180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243251180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243251180">(Jun 19 2021 at 13:57)</a>:</h4>
<p><span class="user-mention silent" data-user-id="322737">jam1garner</span> <a href="#narrow/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint/near/243202203">said</a>:</p>
<blockquote>
<p>however the primary issue still stands: if the method is called on <code>dyn Trait</code>, the trait itself doesn't need to be in scope, meaning our assumption of "there must be an import" is incorrect</p>
</blockquote>
<p>I think there is a way to handle this, but let me read the rest of the topic to see if y'all got there already :)</p>



<a name="243251312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243251312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243251312">(Jun 19 2021 at 14:00)</a>:</h4>
<p>so, because the <code>dyn Trait</code> method is inherent</p>



<a name="243251317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243251317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243251317">(Jun 19 2021 at 14:00)</a>:</h4>
<p>you can invoke it without having the trait in scope</p>



<a name="243251320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243251320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243251320">(Jun 19 2021 at 14:00)</a>:</h4>
<p>by inserting the right number of <code>*</code></p>



<a name="243251321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243251321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243251321">(Jun 19 2021 at 14:00)</a>:</h4>
<p>e.g.</p>



<a name="243251323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243251323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243251323">(Jun 19 2021 at 14:01)</a>:</h4>
<div class="codehilite"><pre><span></span><code>        (*get_dyn_trait()).try_into().unwrap()
</code></pre></div>



<a name="243251330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243251330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243251330">(Jun 19 2021 at 14:01)</a>:</h4>
<p><a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=ab3cedcd6cba56a04dba7752994606e8">playground link</a></p>



<a name="243251334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243251334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243251334">(Jun 19 2021 at 14:01)</a>:</h4>
<p><span class="user-mention" data-user-id="322737">@jam1garner</span> <span aria-label="point up" class="emoji emoji-1f446" role="img" title="point up">:point_up:</span></p>



<a name="243251337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243251337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243251337">(Jun 19 2021 at 14:01)</a>:</h4>
<p>this would actually work for <em>any</em> inherent method</p>



<a name="243251382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243251382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243251382">(Jun 19 2021 at 14:02)</a>:</h4>
<p>alternatively you could do</p>



<a name="243251386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243251386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243251386">(Jun 19 2021 at 14:02)</a>:</h4>
<div class="codehilite"><pre><span></span><code>        (&amp;*get_dyn_trait()).try_into().unwrap()
</code></pre></div>



<a name="243251391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243251391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243251391">(Jun 19 2021 at 14:02)</a>:</h4>
<p>basically, use the same "add-auto-ref-and-auto-deref" algorithm, but keep the <code>.</code> notation</p>



<a name="243266357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243266357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243266357">(Jun 19 2021 at 20:00)</a>:</h4>
<p>yeah that's what i said yesterday</p>



<a name="243267712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243267712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243267712">(Jun 19 2021 at 20:34)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> can you clarify the desired outcome of <code>future-prelude-collision-shadow.rs</code>? it's marked as <code>check-pass</code>, but has an <code>ERROR</code> comment included. Should it be compile-fail, or should it be check-pass but not have the ERROR? I'm honestly not sure what it could be testing, even if I can vaguely see the intention</p>



<a name="243267754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243267754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243267754">(Jun 19 2021 at 20:34)</a>:</h4>
<p>(asking mainly because "editing the test you made so it passes without understanding it" sounds like a bad idea :P)</p>



<a name="243268654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243268654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243268654">(Jun 19 2021 at 20:55)</a>:</h4>
<p><span class="user-mention" data-user-id="322737">@jam1garner</span> I think the "check-pass" was in error</p>



<a name="243268658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243268658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243268658">(Jun 19 2021 at 20:55)</a>:</h4>
<p><span class="user-mention silent" data-user-id="310399">Mara</span> <a href="#narrow/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint/near/243266357">said</a>:</p>
<blockquote>
<p>yeah that's what i said yesterday</p>
</blockquote>
<p>ok, sorry, I didn't follow :)</p>



<a name="243268663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243268663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243268663">(Jun 19 2021 at 20:55)</a>:</h4>
<p>the test arose from me exploring different scenarios</p>



<a name="243268672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243268672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243268672">(Jun 19 2021 at 20:55)</a>:</h4>
<p>that particular one created a compilation error, so and hence didn't need to be migrated, I wanted to document that</p>



<a name="243272225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243272225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243272225">(Jun 19 2021 at 22:29)</a>:</h4>
<p>hmmmm. I can't seem to get it to expect cargo-fix to still fail to compile</p>



<a name="243272284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243272284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243272284">(Jun 19 2021 at 22:30)</a>:</h4>
<p>as far as I can tell from the rustc dev guide, there isn't anything for run-rustfix to produce a failing build</p>



<a name="243272826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243272826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243272826">(Jun 19 2021 at 22:45)</a>:</h4>
<p>However, I've fixed the last FIXME + the issue I found. So I believe "should we remove the compile fail test" is the last outstanding issue I know about?</p>



<a name="243272828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243272828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243272828">(Jun 19 2021 at 22:45)</a>:</h4>
<p>(and have pushed that as a commit)</p>



<a name="243274293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243274293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243274293">(Jun 19 2021 at 23:24)</a>:</h4>
<p>I summarized the remaining two issues better on github: <a href="https://github.com/rust-lang/rust/pull/85707#issuecomment-864473967">https://github.com/rust-lang/rust/pull/85707#issuecomment-864473967</a></p>
<p>I think it's ready for re-review?</p>



<a name="243401196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243401196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243401196">(Jun 21 2021 at 15:38)</a>:</h4>
<p>So, I was just reading over the PR, but it seems like it doesn't have a test for the dyn case?</p>



<a name="243401228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243401228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243401228">(Jun 21 2021 at 15:38)</a>:</h4>
<p>Did I miss something?</p>



<a name="243401562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243401562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243401562">(Jun 21 2021 at 15:40)</a>:</h4>
<p><span class="user-mention" data-user-id="322737">@jam1garner</span> do you have a test to add? I can try to make one</p>



<a name="243401829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243401829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243401829">(Jun 21 2021 at 15:42)</a>:</h4>
<p>There was a test case linked earlier in this thread: <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=3465791fd3f15823212fa413e522ec1c">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=3465791fd3f15823212fa413e522ec1c</a></p>



<a name="243402620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243402620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243402620">(Jun 21 2021 at 15:48)</a>:</h4>
<p>Ah yep forgot to add that to the rust tree. Feel free to if you’d like, otherwise I’ll add it when I get off work</p>



<a name="243402715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243402715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243402715">(Jun 21 2021 at 15:49)</a>:</h4>
<p>I've got a test</p>



<a name="243402723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243402723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243402723">(Jun 21 2021 at 15:49)</a>:</h4>
<p>I was trying to make a test for other sorts of inherent methods</p>



<a name="243402731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243402731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243402731">(Jun 21 2021 at 15:49)</a>:</h4>
<p>but it didn't quite seem to trigger, for reasons I don't understand</p>



<a name="243402843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243402843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243402843">(Jun 21 2021 at 15:50)</a>:</h4>
<p>by which I mean: no lint, and the code worked in Rust 2021</p>



<a name="243403294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243403294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243403294">(Jun 21 2021 at 15:53)</a>:</h4>
<p>rust works in mysterious ways</p>



<a name="243403419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243403419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243403419">(Jun 21 2021 at 15:54)</a>:</h4>
<p>current status: fighting compile test</p>



<a name="243403514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243403514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243403514">(Jun 21 2021 at 15:54)</a>:</h4>
<p>ok</p>



<a name="243431807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243431807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243431807">(Jun 21 2021 at 19:35)</a>:</h4>
<p><span class="user-mention silent" data-user-id="310399">Mara</span> <a href="#narrow/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint/near/243403294">said</a>:</p>
<blockquote>
<p>rust works in mysterious ways</p>
</blockquote>
<p>Really though. Autoref/autoderef/method resolution has a lot of magic going on to make things Just Work. my main takeaway from this lint is that I understand significantly less about it than I thought :)</p>



<a name="243434691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243434691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243434691">(Jun 21 2021 at 19:58)</a>:</h4>
<p>I feel lke it's largely a success if you didn't know how much you didn't know</p>



<a name="243434702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243434702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243434702">(Jun 21 2021 at 19:58)</a>:</h4>
<p>(i.e., it's not biting you on the regular :)</p>



<a name="243434715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243434715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243434715">(Jun 21 2021 at 19:58)</a>:</h4>
<p>though I do sometimes wish it were simpler</p>



<a name="243435358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243435358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243435358">(Jun 21 2021 at 20:03)</a>:</h4>
<p>yeah no I 100% agree, I couldn't figure out the wording but "the reasoning once you understand any given part is clear but it works exactly how you expect, just not how you think you expect"</p>



<a name="243436471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/243436471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#243436471">(Jun 21 2021 at 20:13)</a>:</h4>
<p>r+d</p>



<a name="244049883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/244049883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jam1garner <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#244049883">(Jun 27 2021 at 04:55)</a>:</h4>
<p><span class="user-mention" data-user-id="310399">@Mara</span> just to keep you in the loop, I submitted a fix for the issue you cc'd me in on, in case you want to review it or anything. (<a href="https://github.com/rust-lang/rust/pull/86657">https://github.com/rust-lang/rust/pull/86657</a>) However the issue/fix is surface-level enough that I'm pretty sure you could also just ignore and let rust-highfive run its course if it doesn't interest you <span aria-label="thumbs up" class="emoji emoji-1f44d" role="img" title="thumbs up">:thumbs_up:</span></p>



<a name="244061022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/244061022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#244061022">(Jun 27 2021 at 10:44)</a>:</h4>
<p><span class="user-mention" data-user-id="322737">@jam1garner</span> that was fast! thanks! looks good to me, but I don't think i should be the one r+'ing it since i'm not on compiler(-contributors).</p>



<a name="245194199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Prelude%20Changes%20Lint/near/245194199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Prelude.20Changes.20Lint.html#245194199">(Jul 07 2021 at 15:00)</a>:</h4>
<p>I ran into a small issue with the lint: <a href="https://github.com/rust-lang/rust/issues/86940">#86940</a></p>
<p>It suggests to change <code>X::from_iter</code> to <code>&lt;X as Trait&gt;::from_iter</code> when it should be <code>&lt;X&lt;_&gt; as Trait&gt;::from_iter</code>.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>